Component({
  properties: {
    height: { type: Number, value: 180 },
    textValue: { type: String, value: "" },
    placeholder: { type: String, value: "请输入..." },
    maxlength: { type: Number, value: 140 }
  },

  data: {
    content: ""
  },

  methods: {
    // textarea输入时计算字数
    textInput(e) {
      let val = e.detail.value;
      let len = parseInt(val.length);
      if (len > this.data.maxlength) return;

      this.setData({
        content: val,
        currentWordNumber: len
      });
    }
  }
});
